/*      */ package dm.jdbc.driver;
/*      */ 
/*      */ import dm.jdbc.dbaccess.DBError;
/*      */ import dm.jdbc.desc.DTypeInfo;
/*      */ import java.sql.SQLException;
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ public class DmdbType
/*      */ {
/*      */   static final String VERSION = "7.1.4.74";
/*      */   static final String EXECUTE2_VERSION = "7.1.2.128";
/*      */   static final String BUILD_TIME = "2015.08.13";
/*      */   static final String DRIVER_NAME = "dm.jdbc.driver.DmDriver";
/*      */   static final String DATABASE_PRODUCT_VERSION = "7.0.0.9";
/*      */   
/*      */   public static String getVersion()
/*      */   {
/*   37 */     return "7.1.4.74";
/*      */   }
/*      */   
/*      */ 
/*      */ 
/*      */ 
/*      */   public static String getGlobalVersion()
/*      */   {
/*   45 */     return "7.1.2.128";
/*      */   }
/*      */   
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */   public static String getDbProductVer()
/*      */   {
/*   67 */     return "7.0.0.9";
/*      */   }
/*      */   
/*      */ 
/*   71 */   public static int JDBC_VERSION = 3;
/*      */   
/*      */   public static final int CURSOR = 50;
/*      */   
/*      */   public static final int ORACLE_CURSOR = -10;
/*      */   
/*      */   public static final int DATA_CHAR = 0;
/*      */   
/*      */   public static final int DATA_VARCHAR2 = 1;
/*      */   
/*      */   public static final int DATA_VARCHAR = 2;
/*      */   
/*      */   public static final int DATA_BIT = 3;
/*      */   
/*      */   public static final int DATA_VARBIT = 4;
/*      */   
/*      */   public static final int DATA_TINYINT = 5;
/*      */   
/*      */   public static final int DATA_SMALLINT = 6;
/*      */   
/*      */   public static final int DATA_INT = 7;
/*      */   
/*      */   public static final int DATA_INT64 = 8;
/*      */   
/*      */   public static final int DATA_XDEC = 9;
/*      */   
/*      */   public static final int DATA_FLOAT = 10;
/*      */   
/*      */   public static final int DATA_DOUBLE = 11;
/*      */   
/*      */   public static final int DATA_BLOB = 12;
/*      */   
/*      */   public static final int DATA_BOOLEAN = 13;
/*      */   
/*      */   public static final int DATA_DATE = 14;
/*      */   
/*      */   public static final int DATA_TIME = 15;
/*      */   
/*      */   public static final int DATA_DATETIME = 16;
/*      */   
/*      */   public static final int DATA_BINARY = 17;
/*      */   
/*      */   public static final int DATA_VARBINARY = 18;
/*      */   public static final int DATA_TEXT = 19;
/*      */   public static final int DATA_INTERVAL_YM = 20;
/*      */   public static final int DATA_INTERVAL_DT = 21;
/*      */   public static final int DATA_TIME_TZ = 22;
/*      */   public static final int DATA_DATETIME_TZ = 23;
/*      */   public static final int DATA_DEC_INT64 = 24;
/*      */   public static final int DATA_NULL = 25;
/*      */   public static final int DATA_ANY = 31;
/*      */   public static final int DATA_STAR_ALL = 32;
/*      */   public static final int DATA_STAR = 33;
/*      */   public static final int DATA_RECORD = 40;
/*      */   public static final int DATA_TYPE = 41;
/*      */   public static final int DATA_TYPE_REF = 42;
/*      */   public static final int DATA_UNKNOWN = 54;
/*      */   private static final int DATA_LOCAL_TIME_ZONE_MASK = 4096;
/*      */   public static final int PLTYPE_ARRAY = 117;
/*      */   public static final int PLTYPE_CLASS = 119;
/*      */   public static final int PLTYPE_CURSOR = 120;
/*      */   public static final int PLTYPE_RECORD = 121;
/*      */   public static final int PLTYPE_SARRAY = 122;
/*      */   public static final int DATA_BIT_LEN = 1;
/*      */   public static final int DATA_TINYINT_LEN = 1;
/*      */   public static final int DATA_SMALLINT_LEN = 2;
/*      */   public static final int DATA_INT_LEN = 4;
/*      */   public static final int DATA_INT64_LEN = 8;
/*      */   public static final int DATA_FLOAT_LEN = 4;
/*      */   public static final int DATA_DOUBLE_LEN = 8;
/*      */   public static final int DATA_DATE_LEN = 3;
/*      */   public static final int DATA_TIME_LEN = 5;
/*      */   public static final int DATA_DATETIME_LEN = 8;
/*      */   public static final int DATA_INTERVAL_YM_LEN = 12;
/*      */   public static final int DATA_INTERVAL_DT_LEN = 24;
/*      */   public static final int DATA_TIME_TZ_LEN = 12;
/*      */   public static final int DATA_DATETIME_TZ_LEN = 12;
/*      */   
/*      */   public static boolean isLocalTimeZone(int type, int scale)
/*      */   {
/*  151 */     if ((type == 16) && ((scale & 0x1000) != 0)) {
/*  152 */       return true;
/*      */     }
/*  154 */     return false;
/*      */   }
/*      */   
/*      */   public static boolean isNumberType(int dType)
/*      */   {
/*  159 */     if ((dType == 7) || (dType == 6) || (dType == 8) || 
/*  160 */       (dType == 5)) {
/*  161 */       return true;
/*      */     }
/*  163 */     return false;
/*      */   }
/*      */   
/*      */   public static int localTimeZoneRealPrec(int prec)
/*      */   {
/*  168 */     return prec & 0xEFFF;
/*      */   }
/*      */   
/*      */ 
/*      */ 
/*      */   public static final int DATA_DEC_INT64_LEN = 8;
/*      */   
/*      */ 
/*      */   public static final int DATA_NULL_LEN = 4;
/*      */   
/*      */ 
/*      */   public static final int MAX_STRING_LEN = 8188;
/*      */   
/*      */ 
/*      */   public static final int MAX_DMINTVER_LOADPREC = 9;
/*      */   
/*      */ 
/*      */   public static final int MAX_DMINTVER_SECDPREC = 6;
/*      */   
/*      */ 
/*      */   public static final int DATA_JIO_INVALID = -1;
/*      */   
/*      */ 
/*      */   public static final int DATA_JIO_BOOLEAN = 0;
/*      */   
/*      */ 
/*      */   public static final int DATA_JIO_BYTE = 1;
/*      */   
/*      */ 
/*      */   public static final int DATA_JIO_SHORT = 2;
/*      */   
/*      */ 
/*      */   public static final int DATA_JIO_INTEGER = 3;
/*      */   
/*      */ 
/*      */   public static final int DATA_JIO_LONG = 4;
/*      */   
/*      */ 
/*      */   public static final int DATA_JIO_FLOAT = 5;
/*      */   
/*      */ 
/*      */   public static final int DATA_JIO_DOUBLE = 6;
/*      */   
/*      */ 
/*      */   public static final int DATA_JIO_BIGDEC = 7;
/*      */   
/*      */ 
/*      */   public static final int DATA_JIO_DATE = 8;
/*      */   
/*      */ 
/*      */   public static final int DATA_JIO_TIME = 9;
/*      */   
/*      */ 
/*      */   public static final int DATA_JIO_TIMESTAMP = 10;
/*      */   
/*      */ 
/*      */   public static final int DATA_JIO_DM_TIME = 11;
/*      */   
/*      */ 
/*      */   public static final int DATA_JIO_DM_INTV_YM = 12;
/*      */   
/*      */ 
/*      */   public static final int DATA_JIO_DM_INTV_DT = 13;
/*      */   
/*      */ 
/*      */   public static final int DATA_JIO_STRING = 14;
/*      */   
/*      */   public static final int DATA_JIO_BYTE_ARR = 15;
/*      */   
/*      */   public static final int DATA_JIO_BLOB = 16;
/*      */   
/*      */   public static final int DATA_JIO_CLOB = 17;
/*      */   
/*      */   public static final int DATA_JIO_READER = 18;
/*      */   
/*      */   public static final int DATA_JIO_INPUTSTREAM = 19;
/*      */   
/*      */   public static final int DATA_JIO_ARRAY = 20;
/*      */   
/*      */   public static final int DATA_JIO_STRUCT = 21;
/*      */   
/*      */   public static final int DATA_JIO_TIMEZONE = 22;
/*      */   
/*      */   public static final int DATA_JIO_CHAR = 23;
/*      */   
/*      */   public static final int DATA_JIO_NULL = 24;
/*      */   
/*      */   public static final int DATA_JIO_OBJECT = 25;
/*      */   
/*      */   public static final int DATA_JIO_REF = 26;
/*      */   
/*      */   public static final int DATA_JIO_URL = 27;
/*      */   
/*      */   public static final int OBJ_BLOB_MAGIC = 78111999;
/*      */   
/*      */   public static final int CLTN_TYPE_IND_TABLE = 3;
/*      */   
/*      */   public static final int CLTN_TYPE_NST_TABLE = 2;
/*      */   
/*      */   public static final int CLTN_TYPE_VARRAY = 1;
/*      */   
/*      */   public static final int INTERVAL_YEAR = 0;
/*      */   
/*      */   public static final int INTERVAL_YEAR_TO_MONTH = 1;
/*      */   
/*      */   public static final int INTERVAL_MONTH = 2;
/*      */   
/*      */   public static final int INTERVAL_DAY = 3;
/*      */   
/*      */   public static final int INTERVAL_DAY_TO_HOUR = 4;
/*      */   
/*      */   public static final int INTERVAL_DAY_TO_MIMUTE = 5;
/*      */   
/*      */   public static final int INTERVAL_DAY_TO_SECOND = 6;
/*      */   
/*      */   public static final int INTERVAL_HOUR = 7;
/*      */   
/*      */   public static final int INTERVAL_HOUR_TO_MIMUTE = 8;
/*      */   
/*      */   public static final int INTERVAL_HOUR_TO_SECOND = 9;
/*      */   
/*      */   public static final int INTERVAL_MIMUTE = 10;
/*      */   
/*      */   public static final int INTERVAL_MIMUTE_TO_SECOND = 11;
/*      */   
/*      */   public static final int INTERVAL_SECOND = 12;
/*      */   
/*      */   public static final int ARRAY_TYPE_SHORT = 1;
/*      */   
/*      */   public static final int ARRAY_TYPE_INTEGER = 2;
/*      */   
/*      */   public static final int ARRAY_TYPE_LONG = 3;
/*      */   
/*      */   public static final int ARRAY_TYPE_FLOAT = 4;
/*      */   
/*      */   public static final int ARRAY_TYPE_DOUBLE = 5;
/*      */   
/*      */   public static final int CPrecToJdbcPrec(int jSqlType, int cprec, int scale)
/*      */   {
/*  307 */     int jPrec = 0;
/*      */     
/*  309 */     switch (jSqlType)
/*      */     {
/*      */     case -7: 
/*  312 */       jPrec = 1;
/*  313 */       break;
/*      */     case -6: 
/*  315 */       jPrec = 3;
/*  316 */       break;
/*      */     case -5: 
/*  318 */       jPrec = 19;
/*  319 */       break;
/*      */     case -4: 
/*      */     case -3: 
/*      */     case -2: 
/*  323 */       jPrec = cprec;
/*  324 */       break;
/*      */     case -1: 
/*  326 */       jPrec = cprec;
/*  327 */       break;
/*      */     case 0: 
/*      */     case 2: 
/*      */     case 3: 
/*  331 */       jPrec = cprec;
/*  332 */       break;
/*      */     case 4: 
/*  334 */       jPrec = 10;
/*  335 */       break;
/*      */     case 5: 
/*  337 */       jPrec = 5;
/*  338 */       break;
/*      */     case 6: 
/*  340 */       jPrec = 53;
/*  341 */       break;
/*      */     case 7: 
/*  343 */       jPrec = 24;
/*  344 */       break;
/*      */     case 8: 
/*  346 */       jPrec = 53;
/*  347 */       break;
/*      */     case 1: 
/*      */     case 12: 
/*  350 */       jPrec = cprec;
/*  351 */       break;
/*      */     case 16: 
/*  353 */       jPrec = 1;
/*  354 */       break;
/*      */     case 91: 
/*  356 */       jPrec = 10;
/*  357 */       break;
/*      */     case 92: 
/*  359 */       if (scale != 0) {
/*  360 */         jPrec = 9 + scale;
/*      */       } else
/*  362 */         jPrec = 8;
/*  363 */       break;
/*      */     case 93: 
/*  365 */       if (scale != 0) {
/*  366 */         jPrec = 20 + localTimeZoneRealPrec(scale);
/*      */       } else
/*  368 */         jPrec = 19;
/*  369 */       break;
/*      */     
/*      */     default: 
/*  372 */       jPrec = cprec;
/*      */     }
/*      */     
/*      */     
/*  376 */     return jPrec;
/*      */   }
/*      */   
/*      */ 
/*      */   public static final int displaySizeByJdbcType(int jSqlType, int cprec, int scale)
/*      */   {
/*  382 */     int jPrec = 0;
/*      */     
/*  384 */     switch (jSqlType)
/*      */     {
/*      */     case -7: 
/*  387 */       jPrec = 1;
/*  388 */       break;
/*      */     case -6: 
/*  390 */       jPrec = 4;
/*  391 */       break;
/*      */     case 5: 
/*  393 */       jPrec = 6;
/*  394 */       break;
/*      */     case 4: 
/*  396 */       jPrec = 11;
/*  397 */       break;
/*      */     case 7: 
/*  399 */       jPrec = 25;
/*  400 */       break;
/*      */     case 6: 
/*  402 */       jPrec = 54;
/*  403 */       break;
/*      */     case -5: 
/*  405 */       jPrec = 20;
/*  406 */       break;
/*      */     case -4: 
/*      */     case -3: 
/*      */     case -2: 
/*  410 */       jPrec = cprec * 2;
/*  411 */       break;
/*      */     case -1: 
/*  413 */       jPrec = cprec;
/*  414 */       break;
/*      */     case 0: 
/*      */     case 2: 
/*      */     case 3: 
/*  418 */       jPrec = cprec + 2;
/*  419 */       break;
/*      */     case 8: 
/*  421 */       jPrec = 53;
/*  422 */       break;
/*      */     case 1: 
/*      */     case 12: 
/*  425 */       jPrec = cprec;
/*  426 */       break;
/*      */     case 16: 
/*  428 */       jPrec = 1;
/*  429 */       break;
/*      */     case 91: 
/*  431 */       jPrec = 10;
/*  432 */       break;
/*      */     case 92: 
/*  434 */       if (scale != 0) {
/*  435 */         jPrec = 9 + scale;
/*      */       } else
/*  437 */         jPrec = 8;
/*  438 */       break;
/*      */     case 93: 
/*  440 */       if (scale != 0) {
/*  441 */         jPrec = 20 + localTimeZoneRealPrec(scale);
/*      */       } else
/*  443 */         jPrec = 19;
/*  444 */       break;
/*      */     
/*      */     default: 
/*  447 */       jPrec = cprec;
/*      */     }
/*      */     
/*      */     
/*  451 */     return jPrec;
/*      */   }
/*      */   
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */   public static final int dtypeToSqlType(int dtype, String typeName)
/*      */   {
/*  464 */     int jdbcType = 0;
/*      */     
/*  466 */     switch (dtype)
/*      */     {
/*      */     case 0: 
/*      */     case 1: 
/*  470 */       jdbcType = 1;
/*  471 */       break;
/*      */     case 2: 
/*  473 */       jdbcType = 12;
/*  474 */       break;
/*      */     case 3: 
/*  476 */       if ((typeName != null) && (typeName.equalsIgnoreCase("BOOLEAN")))
/*      */       {
/*  478 */         jdbcType = 16;
/*      */       }
/*      */       else
/*      */       {
/*  482 */         jdbcType = -7;
/*      */       }
/*  484 */       break;
/*      */     case 4: 
/*  486 */       jdbcType = 1;
/*  487 */       break;
/*      */     case 5: 
/*  489 */       jdbcType = -6;
/*  490 */       break;
/*      */     case 6: 
/*  492 */       jdbcType = 5;
/*  493 */       break;
/*      */     case 7: 
/*  495 */       jdbcType = 4;
/*  496 */       break;
/*      */     case 8: 
/*  498 */       jdbcType = -5;
/*  499 */       break;
/*      */     case 9: 
/*      */     case 24: 
/*  502 */       if ((typeName != null) && (
/*  503 */         (typeName.equalsIgnoreCase("NUMERIC")) || (typeName.equalsIgnoreCase("NUMBER")))) {
/*  504 */         jdbcType = 2;
/*      */       } else
/*  506 */         jdbcType = 3;
/*  507 */       break;
/*      */     case 10: 
/*  509 */       jdbcType = 7;
/*  510 */       break;
/*      */     case 11: 
/*  512 */       if ((typeName != null) && (typeName.equalsIgnoreCase("FLOAT"))) {
/*  513 */         jdbcType = 6;
/*      */       } else
/*  515 */         jdbcType = 8;
/*  516 */       break;
/*      */     case 12: 
/*  518 */       if ((typeName != null) && (typeName.equalsIgnoreCase("LONGVARBINARY"))) {
/*  519 */         jdbcType = -4;
/*      */       } else
/*  521 */         jdbcType = 2004;
/*  522 */       break;
/*      */     case 13: 
/*  524 */       jdbcType = 16;
/*  525 */       break;
/*      */     case 14: 
/*  527 */       jdbcType = 91;
/*  528 */       break;
/*      */     case 15: 
/*  530 */       jdbcType = 92;
/*  531 */       break;
/*      */     case 16: 
/*  533 */       jdbcType = 93;
/*  534 */       break;
/*      */     case 17: 
/*  536 */       jdbcType = -2;
/*  537 */       break;
/*      */     case 18: 
/*  539 */       jdbcType = -3;
/*  540 */       break;
/*      */     case 19: 
/*  542 */       if ((typeName != null) && (typeName.equalsIgnoreCase("LONGVARCHAR"))) {
/*  543 */         jdbcType = -1;
/*      */       } else
/*  545 */         jdbcType = 2005;
/*  546 */       break;
/*      */     case 20: 
/*      */     case 21: 
/*      */     case 22: 
/*      */     case 23: 
/*  551 */       jdbcType = 2000;
/*  552 */       break;
/*      */     case 54: 
/*  554 */       jdbcType = 12;
/*  555 */       break;
/*      */     
/*      */     case 117: 
/*      */     case 122: 
/*  559 */       jdbcType = 2003;
/*  560 */       break;
/*      */     
/*      */     case 119: 
/*      */     case 121: 
/*  564 */       jdbcType = 2002;
/*  565 */       break;
/*      */     
/*      */     default: 
/*  568 */       jdbcType = 0;
/*      */     }
/*      */     
/*      */     
/*  572 */     return jdbcType;
/*      */   }
/*      */   
/*      */ 
/*      */   public static final boolean isNUMERICtype(int type)
/*      */   {
/*  578 */     if ((type == -5) || (type == 3) || (type == 8) || (type == 6) || 
/*  579 */       (type == 7) || (type == 4) || (type == 5) || 
/*  580 */       (type == -6) || (type == 2))
/*      */     {
/*  582 */       return true;
/*      */     }
/*      */     
/*  585 */     return false;
/*      */   }
/*      */   
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */   public static final int getIntervalLoadPrec(int typePrec)
/*      */   {
/*  629 */     int prec = (typePrec & 0xF0) >> 4;
/*      */     
/*  631 */     return prec;
/*      */   }
/*      */   
/*      */   public static final int getIntervalScale(int typePrec)
/*      */   {
/*  636 */     int scale = 2;
/*  637 */     int type = (typePrec & 0xFF00) >> 8;
/*  638 */     if ((type == 6) || (type == 9) || 
/*  639 */       (type == 11) || (type == 12))
/*      */     {
/*  641 */       scale = typePrec & 0xF;
/*      */     }
/*      */     
/*  644 */     return scale;
/*      */   }
/*      */   
/*      */ 
/*      */   public static final String interval_dtype_to_name(int scale)
/*      */   {
/*  650 */     String name = "";
/*      */     
/*  652 */     int qua = (scale & 0xFF00) >> 8;
/*  653 */     int lead_prec = (scale & 0xF0) >> 4;
/*  654 */     int second_prec = scale & 0xF;
/*      */     
/*  656 */     switch (qua)
/*      */     {
/*      */     case 0: 
/*  659 */       name = "INTERVAL YEAR(" + lead_prec + ")";
/*  660 */       break;
/*      */     
/*      */     case 2: 
/*  663 */       name = "INTERVAL MONTH(" + lead_prec + ")";
/*  664 */       break;
/*      */     
/*      */     case 3: 
/*  667 */       name = "INTERVAL DAY(" + lead_prec + ")";
/*  668 */       break;
/*      */     
/*      */     case 7: 
/*  671 */       name = "INTERVAL HOUR(" + lead_prec + ")";
/*  672 */       break;
/*      */     
/*      */     case 10: 
/*  675 */       name = "INTERVAL MINUTE(" + lead_prec + ")";
/*  676 */       break;
/*      */     
/*      */     case 12: 
/*  679 */       name = "INTERVAL SECOND(" + lead_prec + "," + second_prec + ")";
/*  680 */       break;
/*      */     
/*      */     case 1: 
/*  683 */       name = "INTERVAL YEAR(" + lead_prec + ") TO MONTH";
/*  684 */       break;
/*      */     
/*      */     case 4: 
/*  687 */       name = "INTERVAL DAY(" + lead_prec + ") TO HOUR";
/*  688 */       break;
/*      */     
/*      */     case 5: 
/*  691 */       name = "INTERVAL DAY(" + lead_prec + ") TO MINUTE";
/*  692 */       break;
/*      */     
/*      */     case 6: 
/*  695 */       name = "INTERVAL DAY(" + lead_prec + ") TO SECOND(" + second_prec + ")";
/*  696 */       break;
/*      */     
/*      */     case 8: 
/*  699 */       name = "INTERVAL HOUR(" + lead_prec + ") TO MINUTE";
/*  700 */       break;
/*      */     
/*      */     case 9: 
/*  703 */       name = "INTERVAL HOUR(" + lead_prec + ") TO SECOND(" + second_prec + ")";
/*  704 */       break;
/*      */     
/*      */     case 11: 
/*  707 */       name = "INTERVAL MINUTE(" + lead_prec + ") TO SECOND(" + second_prec + ")";
/*      */     }
/*      */     
/*      */     
/*  711 */     return name;
/*      */   }
/*      */   
/*      */   static boolean dtype_is_fixed_low(int dtype)
/*      */   {
/*  716 */     switch (dtype)
/*      */     {
/*      */     case 0: 
/*  719 */       return true;
/*      */     
/*      */     case 1: 
/*      */     case 2: 
/*  723 */       return false;
/*      */     
/*      */     case 3: 
/*  726 */       return true;
/*      */     
/*      */     case 4: 
/*  729 */       return false;
/*      */     
/*      */     case 7: 
/*  732 */       return true;
/*      */     
/*      */     case 8: 
/*  735 */       return true;
/*      */     
/*      */     case 6: 
/*  738 */       return true;
/*      */     
/*      */     case 5: 
/*  741 */       return true;
/*      */     
/*      */     case 9: 
/*      */     case 24: 
/*  745 */       return true;
/*      */     
/*      */     case 10: 
/*  748 */       return true;
/*      */     
/*      */     case 11: 
/*  751 */       return true;
/*      */     
/*      */     case 12: 
/*  754 */       return false;
/*      */     
/*      */     case 19: 
/*  757 */       return false;
/*      */     
/*      */     case 14: 
/*  760 */       return true;
/*      */     
/*      */     case 15: 
/*  763 */       return true;
/*      */     
/*      */     case 16: 
/*  766 */       return true;
/*      */     
/*      */     case 20: 
/*  769 */       return true;
/*      */     
/*      */     case 21: 
/*  772 */       return true;
/*      */     
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */     case 17: 
/*  780 */       return true;
/*      */     
/*      */     case 18: 
/*  783 */       return false;
/*      */     
/*      */     case 25: 
/*  786 */       return true;
/*      */     }
/*      */     
/*  789 */     return false;
/*      */   }
/*      */   
/*      */   static int dtype_get_internal_len_low(int dtype, int len)
/*      */   {
/*  794 */     switch (dtype)
/*      */     {
/*      */     case 7: 
/*  797 */       return 4;
/*      */     
/*      */     case 0: 
/*  800 */       return len;
/*      */     
/*      */     case 9: 
/*  803 */       return (2 + 
/*      */       
/*  805 */         len + 1) / 2;
/*      */     
/*      */     case 11: 
/*  808 */       return 8;
/*      */     
/*      */     case 6: 
/*  811 */       return 2;
/*      */     
/*      */     case 8: 
/*  814 */       return 8;
/*      */     
/*      */     case 5: 
/*  817 */       return 1;
/*      */     
/*      */     case 10: 
/*  820 */       return 4;
/*      */     
/*      */     case 14: 
/*  823 */       return 3;
/*      */     
/*      */     case 15: 
/*  826 */       return 5;
/*      */     
/*      */     case 16: 
/*  829 */       return 8;
/*      */     
/*      */     case 17: 
/*  832 */       return len;
/*      */     
/*      */     case 3: 
/*  835 */       return 1;
/*      */     
/*      */     case 20: 
/*  838 */       return 12;
/*      */     
/*      */     case 21: 
/*  841 */       return 24;
/*      */     
/*      */     case 25: 
/*  844 */       return 4;
/*      */     
/*      */     case 24: 
/*  847 */       return 8;
/*      */     }
/*      */     
/*      */     
/*      */ 
/*      */ 
/*      */ 
/*  854 */     return 0;
/*      */   }
/*      */   
/*      */   public static final DTypeInfo getDtypeByJType(int Jtype, int Jprec, int Jscale, int sDtype, int sPrec, int sScale)
/*      */     throws SQLException
/*      */   {
/*  860 */     int dType = 0;int prec = 0;int scale = 0;
/*  861 */     switch (Jtype)
/*      */     {
/*      */     case 0: 
/*      */     case 1: 
/*  865 */       dType = 5;
/*  866 */       prec = 1;
/*  867 */       scale = 0;
/*  868 */       break;
/*      */     
/*      */     case 2: 
/*  871 */       dType = 6;
/*  872 */       prec = 2;
/*  873 */       scale = 0;
/*  874 */       break;
/*      */     
/*      */     case 3: 
/*  877 */       dType = 7;
/*  878 */       prec = 4;
/*  879 */       scale = 0;
/*  880 */       break;
/*      */     
/*      */     case 4: 
/*  883 */       dType = 8;
/*  884 */       prec = 8;
/*  885 */       scale = 0;
/*  886 */       break;
/*      */     
/*      */     case 5: 
/*  889 */       dType = 10;
/*  890 */       prec = 0;
/*  891 */       scale = 0;
/*  892 */       break;
/*      */     
/*      */     case 6: 
/*  895 */       dType = 11;
/*  896 */       prec = 0;
/*  897 */       scale = 0;
/*  898 */       break;
/*      */     
/*      */     case 7: 
/*  901 */       if ((sDtype != 10) && (sDtype != 11))
/*      */       {
/*  903 */         dType = 9;
/*  904 */         prec = 0;
/*  905 */         scale = 0;
/*      */       }
/*      */       else
/*      */       {
/*  909 */         dType = sDtype;
/*  910 */         prec = sPrec;
/*  911 */         scale = sScale;
/*      */       }
/*  913 */       break;
/*      */     
/*      */     case 8: 
/*  916 */       dType = 14;
/*  917 */       prec = 3;
/*  918 */       scale = 0;
/*  919 */       break;
/*      */     
/*      */     case 9: 
/*  922 */       dType = 15;
/*  923 */       prec = 5;
/*  924 */       scale = 0;
/*  925 */       break;
/*      */     
/*      */     case 10: 
/*  928 */       dType = 16;
/*  929 */       prec = 8;
/*  930 */       scale = 0;
/*  931 */       break;
/*      */     
/*      */     case 11: 
/*  934 */       dType = 15;
/*  935 */       prec = 5;
/*  936 */       scale = 0;
/*  937 */       break;
/*      */     
/*      */     case 12: 
/*  940 */       dType = 20;
/*  941 */       prec = 0;
/*  942 */       scale = Jprec;
/*  943 */       break;
/*      */     
/*      */     case 13: 
/*  946 */       dType = 21;
/*  947 */       prec = 0;
/*  948 */       scale = Jprec;
/*  949 */       break;
/*      */     
/*      */     case 14: 
/*  952 */       dType = 2;
/*  953 */       prec = 8188;
/*  954 */       scale = 0;
/*  955 */       break;
/*      */     
/*      */     case 15: 
/*  958 */       dType = 18;
/*  959 */       prec = 8188;
/*  960 */       scale = 0;
/*  961 */       break;
/*      */     
/*      */     case 16: 
/*  964 */       dType = 12;
/*  965 */       prec = sPrec;
/*  966 */       scale = 0;
/*  967 */       break;
/*      */     
/*      */     case 17: 
/*  970 */       dType = 19;
/*  971 */       prec = sPrec;
/*  972 */       scale = 0;
/*  973 */       break;
/*      */     
/*      */     case 18: 
/*  976 */       if ((sDtype == 0) || (sDtype == 1) || (sDtype == 2) || 
/*  977 */         (sDtype == 17) || (sDtype == 18))
/*      */       {
/*  979 */         dType = 2;
/*  980 */         prec = 8188;
/*  981 */         scale = 0;
/*      */       }
/*  983 */       else if ((sDtype == 12) || (sDtype == 19))
/*      */       {
/*  985 */         dType = 19;
/*  986 */         prec = Integer.MAX_VALUE;
/*  987 */         scale = 0;
/*      */       }
/*      */       else {
/*  990 */         DBError.throwSQLException(6007); }
/*  991 */       break;
/*      */     
/*      */     case 19: 
/*  994 */       if ((sDtype == 0) || (sDtype == 1) || (sDtype == 2) || 
/*  995 */         (sDtype == 17) || (sDtype == 18))
/*      */       {
/*  997 */         dType = 18;
/*  998 */         prec = 8188;
/*  999 */         scale = 0;
/*      */       }
/* 1001 */       else if ((sDtype == 12) || (sDtype == 19))
/*      */       {
/* 1003 */         dType = 12;
/* 1004 */         prec = Integer.MAX_VALUE;
/* 1005 */         scale = 0;
/*      */       }
/*      */       else {
/* 1008 */         DBError.throwSQLException(6007); }
/* 1009 */       break;
/*      */     
/*      */     case 20: 
/*      */     case 21: 
/* 1013 */       dType = sDtype;
/* 1014 */       prec = 1;
/* 1015 */       scale = 0;
/* 1016 */       break;
/*      */     
/*      */     case 22: 
/* 1019 */       dType = sDtype;
/* 1020 */       prec = 0;
/* 1021 */       scale = sScale;
/* 1022 */       break;
/*      */     
/*      */     case 23: 
/* 1025 */       dType = 0;
/* 1026 */       prec = 1;
/* 1027 */       scale = 0;
/* 1028 */       break;
/*      */     
/*      */     default: 
/* 1031 */       DBError.throwSQLException(6007);
/*      */     }
/*      */     
/*      */     
/* 1035 */     return new DTypeInfo(dType, prec, scale);
/*      */   }
/*      */   
/*      */ 
/*      */   public static final boolean emptyStringToNull(int dType)
/*      */   {
/* 1041 */     switch (dType)
/*      */     {
/*      */     case 3: 
/*      */     case 5: 
/*      */     case 6: 
/*      */     case 7: 
/*      */     case 8: 
/*      */     case 9: 
/*      */     case 10: 
/*      */     case 11: 
/*      */     case 13: 
/*      */     case 14: 
/*      */     case 15: 
/*      */     case 16: 
/*      */     case 20: 
/*      */     case 21: 
/*      */     case 22: 
/*      */     case 23: 
/*      */     case 24: 
/* 1060 */       return true;
/*      */     }
/*      */     
/* 1063 */     return false;
/*      */   }
/*      */ }


/* Location:              D:\Program Files\DBMS_20150813\jdbc\Dm7JdbcDriver17.jar!\dm\jdbc\driver\DmdbType.class
 * Java compiler version: 2 (46.0)
 * JD-Core Version:       0.7.1
 */